<%@page pageEncoding="UTF-8" isELIgnored="false"%>
<%@include file="/common/common.jsp" %>
<!DOCTYPE html>
<html>
<head>
<%@include file="/common/common_meta.jsp" %>
<%@include file="/common/common_meta_app.jsp" %>
<title>BookPad - 本棚</title>
</head>
<body>
<div data-role="page">
<div data-role="header" data-position="inline"　data-position="fixed">
<h1>${f:h(userData.nickName)}さんの本棚</h1>
<a href="/" data-role="button" data-icon="home" data-iconpos="notext" class="ui-btn-right jqm-home" rel="external"></a>
</div>
<div data-role="content">
<c:if test="${empty bookList}">
<c:if test="${status == 'to_read'}">読みたい本</c:if>
<c:if test="${status == 'in_reading'}">読み中の本</c:if>
<c:if test="${status == 'done'}">読んだ本</c:if>
<c:if test="${empty status}">本</c:if>が本棚にありません。
</c:if>
<c:if test="${!empty bookList}">
<ul data-role="listview" data-inset="true">
<li data-role="list-divider">
<c:if test="${status == 'to_read'}">読みたい本</c:if>
<c:if test="${status == 'in_reading'}">読み中の本</c:if>
<c:if test="${status == 'done'}">読んだ本</c:if>
<c:if test="${empty status}">登録した本</c:if>
</li>
<c:forEach var="book" items="${bookList}" varStatus="status">
  <c:set var="item" value="${book.item}" />
  <c:set var="detailUrl" value="/info/detail/${f:h(item.ASIN)}" />
  
  <li>
	  <a href="${f:url(detailUrl)}" target="_blank">
	    <img src="${f:h(item.URL)}" alt="${f:h(item.Title)}" />${f:h(item.Title)}<br/>
	  </a>
	  <c:if test="${!empty item.Content}">
		<p>${f:br(item.Content)}</p>
	  </c:if>
	  <span class="ui-li-count">${f:h(item.FormattedPrice)}</span>
  </li>
</c:forEach>
</ul>
</c:if>
<ul data-role="listview" data-inset="true">
<li data-role="list-divider">▼本棚</li>
<c:if test="${status != 'to_read'}"><li><a href="${f:url('/bookshelf/list/to_read')}" rel="external">読みたい本</a></li></c:if>
<c:if test="${status != 'in_reading'}"><li><a href="${f:url('/bookshelf/list/in_reading')}" rel="external">読み中の本</a></li></c:if>
<c:if test="${status != 'done'}"><li><a href="${f:url('/bookshelf/list/done')}" rel="external">読んだ本</a></li></c:if>
</ul>
</div>
<%@include file="/common/common_footer.jsp" %>
</div>
</body>
</html>
